﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using DAO_ADMIN;
namespace PTTK19.DB
{
    public class DBChiTietNguyenLieuMonAn
    {
        //update so luong 
        public static void CapNhatSoLuong(int _MaMonAn, int _MaNguyenLieu, int _SoLuong)
        {
            string procname = "sp_CapNhatSoLuongChiTietNguyenLieuMonAn";
            List<SqlParameter> parr = new List<SqlParameter>();
            parr.Add(new SqlParameter("@MaMonAn", _MaMonAn));
            parr.Add(new SqlParameter("@MaNguyenLieu", _MaNguyenLieu));
            parr.Add(new SqlParameter("@SoLuong", _SoLuong));
            DataProvider.NonqueryProc(procname, parr);
        }
        //them nguyen lieu vao mon an
        public static void ThemNguyenLieuVaoMonAn(int _MaMonAn, int _MaNguyenLieu, string _DonViTinh)
        {
            string procname = "sp_ThemNguyenLieuVaoMonAn";
            List<SqlParameter> parr = new List<SqlParameter>();
            parr.Add(new SqlParameter("@MaMonAn", _MaMonAn));
            parr.Add(new SqlParameter("@MaNguyenLieu", _MaNguyenLieu));
            parr.Add(new SqlParameter("@DonViTinh", _DonViTinh));
            DataProvider.NonqueryProc(procname, parr);
        }
        //bot nguyen lieu cua mon an
        public static void BotNguyenLieuChoMonAn(int _MaMonAn, int _MaNguyenLieu)
        {
            string procname = "sp_BotNguyenLieuChoMonAn";
            List<SqlParameter> parr = new List<SqlParameter>();
            parr.Add(new SqlParameter("@MaMonAn", _MaMonAn));
            parr.Add(new SqlParameter("@MaNguyenLieu", _MaNguyenLieu));
            DataProvider.NonqueryProc(procname, parr);
        }

    }
}
